Ad Widget

Collapse

Can`t stop the agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • isurugiu
    Junior Member
    • Apr 2015
    • 13

    #1

    Can`t stop the agent

    I am unsuccessfully trying to stop zabbix-agent

    root@ip-10-50-3-213:~# /etc/init.d/zabbix-agent stop; ps -aux | grep zabb
    * zabbix_agentd stopping... [ OK ]
    zabbix 11631 0.0 0.0 88592 1112 ? S 11:53 0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
    zabbix 11632 0.0 0.0 88592 1044 ? S 11:53 0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
    zabbix 11633 0.0 0.0 88592 900 ? S 11:53 0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
    zabbix 11634 0.0 0.0 88592 900 ? S 11:53 0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
    zabbix 11635 0.0 0.0 88592 900 ? S 11:53 0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
    zabbix 11636 0.0 0.0 88592 1084 ? S 11:53 0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
    root 11640 0.0 0.0 10460 936 pts/0 S+ 11:53 0:00 grep --color=auto zabb


    Even it won't quit after kill -9. Any hints?
    This happens on multiple machines.

    Regards,
    -iulian
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Perhaps, that init script is wrong.

    What OS are using?
    If you use Linux, what distridution and version are using?
    What version are using of Zabbix?
    Did you install any kind of procedure for Zabbix?

    Comment

    • isurugiu
      Junior Member
      • Apr 2015
      • 13

      #3
      I'm using ubuntu 14.04.2 LTS x64 with

      Zabbix Agent (daemon) v2.2.2 (revision 42525) (12 February 2014)

      I can`t say that I have followed a certain procedure. I installed the packages via apt then added the client/custom configuration via chef.

      -Iulian

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        I tried to install Zabbix agent to Ubuntu 14.04.2.
        I used Zabbix SIA repository.
        I can stop that agent by service command.
        Of course, I can stop that agent by call init script.

        Agent version:
        Zabbix Agent (daemon) v2.2.9 (revision 52686) (12 March 2015)

        I think that your init script is not match for Ubuntu 14.04.
        Perhaps, that script is for old version of Ubuntu.
        Plaese check your init script.

        Comment

        • isurugiu
          Junior Member
          • Apr 2015
          • 13

          #5
          Thanks for your reply, but that does not help me very much.

          -Iulian

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #6
            Is it possible that teaching Chef recipes?
            Perhaps I think incorrect init file is located in the recipe.

            Comment

            • isurugiu
              Junior Member
              • Apr 2015
              • 13

              #7
              Zabbix-client is installed via apt by using a chef recipe. On the next step the configuration is replaced with a global one.

              I am not sure what you want me to do. The init scripts were working fine until a few days ago. If you read my post from the top kill -PID or killall -9 zabbix_agentd is not working.

              -Iulian

              Comment

              • Atsushi
                Senior Member
                • Aug 2013
                • 2028

                #8
                Do not that you can not stop with the init script?

                Comment

                • isurugiu
                  Junior Member
                  • Apr 2015
                  • 13

                  #9
                  I am not sure what you mean by that but yest I can't stop by either init script or kill.

                  Comment

                  • Colttt
                    Senior Member
                    Zabbix Certified Specialist
                    • Mar 2009
                    • 878

                    #10
                    can you please post this init-script?
                    Debian-User

                    Sorry for my bad english

                    Comment

                    • isurugiu
                      Junior Member
                      • Apr 2015
                      • 13

                      #11
                      root@sysadmin:~# /etc/init.d/zabbix-agent stop; killall -9 zabbix_agentd;pstree -ahup | grep zab
                      * zabbix_agentd stopping... [ OK ]
                      | |-grep,6644 --color=auto zab
                      `-zabbix_agentd,6646,zabbix -c /etc/zabbix/zabbix_agentd.conf


                      Content of /etc/init.d/zabbix-agent:

                      Code:
                      #! /bin/sh
                      ### BEGIN INIT INFO
                      # Provides:          zabbix-agent
                      # Required-Start:    $remote_fs $network
                      # Required-Stop:     $remote_fs
                      # Default-Start:     2 3 4 5
                      # Default-Stop:      0 1 6
                      # Short-Description: Start zabbix-agent daemon
                      # Description: Start zabbix-agent daemon
                      ### END INIT INFO
                      
                      NAME=zabbix_agentd
                      DAEMON=/usr/sbin/$NAME
                      # Exit if executable is not installed
                      [ -x $DAEMON ] || exit 0
                      
                      DIR=/var/run/zabbix
                      PID=$DIR/$NAME.pid
                      RETRY=TERM/30/KILL/5
                      START=no
                      
                      # Load the VERBOSE setting and other rcS variables
                      [ -f /etc/default/rcS ] && . /etc/default/rcS
                      
                      # define LSB log_* functions.
                      . /lib/lsb/init-functions
                      
                      _ev_ () {
                        [ "$VERBOSE" = "no" ] || eval $@
                      }
                      
                      [ -d "$DIR" ] || mkdir "$DIR"
                      chown -R zabbix:zabbix "$DIR"
                      export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
                      
                      case "$1" in
                        start)
                          start-stop-daemon --start --pidfile $PID --exec $DAEMON --test --quiet > /dev/null
                          [ $? -ne 0 ] && log_action_msg "$NAME is already running" && exit 0
                          _ev_ log_action_begin_msg \"$NAME starting\"
                          R=$(start-stop-daemon --start --pidfile $PID --exec $DAEMON --oknodo 2>&1) \
                          && _ev_ log_action_end_msg 0 \"$R\" \
                          || _ev_ log_action_end_msg 1 \"$R\"
                        ;;
                        stop)
                          _ev_ log_action_begin_msg "$NAME stopping"
                          R=$(start-stop-daemon --stop --pidfile $PID --exec $DAEMON --oknodo --retry=$RETRY 2>&1) \
                          && _ev_ log_action_end_msg 0 \"$R\" \
                          || _ev_ log_action_end_msg 1 \"$R\"
                        ;;
                        status)
                          ## return status 0 if process is running.
                          status_of_proc -p $PID "$DAEMON" "$NAME"
                        ;;
                        restart|force-reload)
                          $0 stop
                          $0 start
                        ;;
                        *)
                          echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
                          exit 1
                        ;;
                      esac

                      Comment

                      • Atsushi
                        Senior Member
                        • Aug 2013
                        • 2028

                        #12
                        I try start and stop agent by your /etc/init.d/zabbix-agent.
                        I tried several times, but i was able to stop and start normally.
                        There was no problem in OS reboot.

                        But, there is a point that does not match the posted information.

                        When I started by this script, start-up option is not added to the zabbix_agentd.

                        Code:
                        root@ubt14:~# pstree -ahup | grep zab
                          |                           |-grep,1689 --color=auto zab
                          `-zabbix_agentd,1594,zabbix
                              |-zabbix_agentd,1596
                              |-zabbix_agentd,1597
                              |-zabbix_agentd,1598
                              |-zabbix_agentd,1599
                              `-zabbix_agentd,1600
                        root@ubt14:~#
                        My environment don't have "-c /etc/zabbix/zabbix_agentd.conf" option.

                        It does not introduce a mechanism to start the agent automatically by using some other way?
                        ex. monit, upstart

                        Comment

                        Working...